import React from 'react';
import {
    Menu,
    Icon
} from 'antd';
import {
	Link,
	Router,
	hashHistory
} from 'react-router';
const SubMenu = Menu.SubMenu;
const MenuItemGroup = Menu.ItemGroup;

const Sider = React.createClass({
    getInitialState() {
        return {
            currentKey: '0',
        };
    },
    handleClick(e) {
        this.setState({
            currentKey: e.key,
        });
    },
    render: function() {
        return (
            <Menu onClick={this.handleClick}
                style={{ width: 180 }}
                defaultOpenKeys={['sub1','sub2']}
                selectedKeys={[this.state.currentKey]}
                mode="inline"
            >
                <Menu.Item key="0"><Icon type="home" />主页</Menu.Item>
                <SubMenu key="sub1" title={<span><Icon type="search" /><span>查询</span></span>}>
                    <MenuItemGroup title="原创教学">
                        <Menu.Item key="1"><Link to={"/kebiao"}>查课表</Link></Menu.Item>
                        <Menu.Item key="2"><Link to={"/score"}>查成绩</Link></Menu.Item>
                    </MenuItemGroup>
                    <MenuItemGroup title="计E学科">
                        <Menu.Item key="3"><Link to={"/points"}>查创新分</Link></Menu.Item>
                        <Menu.Item key="4"><Link to={"/lecture"}>查讲座</Link></Menu.Item>
                    </MenuItemGroup>
                </SubMenu>
                <SubMenu key="sub2" title={<span><Icon type="appstore" /><span>应用</span></span>}>
                    <Menu.Item key="5"><Link to={"/live"}>看直播</Link></Menu.Item>
                </SubMenu>
            </Menu>
        );
    }
});
export default Sider;
